package builderpattern.builder;

import builderpattern.IBMProduct;
import builderpattern.Motherboard;

/**
 * @author Jonny Long
 * @date 2021/5/6 8:26
 */
public class ConcreteBuilderPlan implements Builder {
    private IBMProduct product = new IBMProduct();

    @Override
    public void BuildMonitor() {
        product.setMonitor("IBM----显示器");
    }

    @Override
    public void BuildKeyboard() {
        product.setKeyboard("IBM----显示器");
    }

    @Override
    public void BuildMouse() {
        product.setMouse("IBM----鼠标");
    }

    @Override
    public void BuildMotherBoard() {
        Motherboard motherboard = new Motherboard();
        motherboard.setCPU("IBM----CPU");
        motherboard.setRAM("IBM----RAM");
        product.setMB(motherboard);
    }

    @Override
    public IBMProduct getResult() {
        return product;
    }
}
